#include "StdAfx.h"
#include "cookrace.h"
#include "machine/CookraceMachine.h"

static dip_t dip1[] =
	{
	{"Coin 1",2,3,{{"2 coins/1 credit",0},{"1 coin/3 credits",1},{"1 coin/2 credits",2},{"1 coin/1 credit",3}}},
	{"Coin 2",2,0x0C,{{"2 coins/1 credit",0},{"1 coin/3 credits",4},{"1 coin/2 credits",8},{"1 coin/1 credit",0xC}}},
	{"Unknown",1,0x10,{{"off",0},{"on",0x10}}},
	{"Unknown",1,0x20,{{"off",0},{"on",0x20}}},
	{"Cabinet type",1,0,{{"upright",0},{"cocktail",0x40}}},
	{"VBlank",-1,0,{{"off",0},{"on",0x80}}},
	{0,0,0,0,0}	
	};

static dip_t dip2[] =
	{
	{"Lives",1,1,{{"5",0},{"3",1}}},
	{"Bonus life",2,6,{{"50,000",0},{"40,000",2},{"30,000",4},{"20,000",6}}},
	{"Enemies",1,8,{{"6",0},{"4",8}}},
	{"End of level pepper",1,0x10,{{"on",0},{"off",0x10}}},
	{"Unknown",1,0x20,{{"off",0},{"on",0x20}}},
	{"Difficulty",2,0xC0,{{"very hard",0},{"hard",0x40},{"normal",0x80},{"easy",0xC0}}},
	{0,0,0,0,0}	
	};

static InputPort Ports[3] =
	{
	{{
		{"Right",	I_RIGHT,		0x01,	I_HIGH},
		{"Left",		I_LEFT,		0x02,	I_HIGH},
		{"Up",		I_UP,			0x04,	I_HIGH},
		{"Down",		I_DOWN,		0x08,	I_HIGH},
		{"Button 1",I_B1,			0x10,	I_HIGH},
		{"Unknown",	0,				0x20,	I_HIGH},
		{"Unknown",	0,				0x40,	I_HIGH},
		{"Unknown",	0,				0x80,	I_HIGH},
	}},
	{{
		{"Right",	I2_RIGHT,	0x01,	I_HIGH},
		{"Left",		I2_LEFT,		0x02,	I_HIGH},
		{"Up",		I2_UP,		0x04,	I_HIGH},
		{"Down",		I2_DOWN,		0x08,	I_HIGH},
		{"Button 1",I2_B1,		0x10,	I_HIGH},
		{"Unknown",	0,				0x20,	I_HIGH},
		{"Unknown",	0,				0x40,	I_HIGH},
		{"Unknown",	0,				0x80,	I_HIGH},
	}},
	{{
		{"Unknown",	0,				0x01,	I_HIGH},
		{"Unknown",	0,				0x02,	I_HIGH},
		{"Unknown",	0,				0x04,	I_HIGH},
		{"Start 1",	I_START1,	0x08,	I_HIGH},
		{"Start 2",	I_START2,	0x10,	I_HIGH},
		{"Unknown",	0,				0x20,	I_HIGH},
		{"Coin 2",	I_COIN2,		0x40,	I_LOW | I_CPU_NMI(0)},
		{"Coin 1",	I_COIN1,		0x80,	I_LOW | I_CPU_NMI(0)},
	}}
	};

Ccookrace::Ccookrace()
{
SetName("cookrace");						//set romset name
SetScreen(256,256,ROTATE_270);
SetDip(0,dip1);
SetDip(1,dip2);
SetPort(0,&Ports[0]);
SetPort(1,&Ports[1]);
SetPort(2,&Ports[2]);
AddROM("1f.1",		0x0000,0x2000,0x68759d32,ROM_CPU1);
AddROM("2f.2",		0x2000,0x2000,0xbe7d72d1,ROM_CPU1);
AddROM("2k",		0xFFE0,0x0020,0xe2553b3d,ROM_CPU1);
AddROM("6f.6",		0x0000,0x1000,0x6b8e0272,ROM_CPU2);
AddROM("m8.7",		0x0000,0x2000,0xa1a0d5a6,ROM_VROM1);
AddROM("m7.8",		0x2000,0x2000,0x1104f497,ROM_VROM1);
AddROM("m6.9",		0x4000,0x2000,0xd0d94477,ROM_VROM1);
AddROM("2f.3",		0x0000,0x1000,0x28609a75,ROM_TEMP);
AddROM("4f.4",		0x1000,0x1000,0x7742e771,ROM_TEMP);
AddROM("5f.5",		0x2000,0x1000,0x611c686f,ROM_TEMP);
AddROM("f9.clr",	0x0000,0x0020,0xc2348c1d,ROM_PROM);
AddROM("b7",		0x0020,0x0020,0xe4268fa6,ROM_PROM);
}

CMachine *Ccookrace::CreateMachine()
{
return(new CCookraceMachine());
}
